﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Core {

    public static class NumberHelper {

        /// <summary>
        /// 保留小数点后指定位数但不四舍五入
        /// </summary>
        /// <param name="value"></param>
        /// <param name="num"></param>
        /// <returns></returns>
        public static decimal NumberToFixedNoRound(this decimal value, int num) {
            return ((long)(value * (decimal)Math.Pow(10, num))) / ((decimal)(Math.Pow(10, num)));
        }
    }
}
